var yuanshi = 0
var qian = 0


function mathnum() {
    if (yuanshi < 160) {
        alert('你的原石不够哦')
        return
    }
    var i = Math.floor(Math.random() * 1000)
    if (i <= 3) {
        yuanshi -= 160
        money.innerHTML = yuanshi;
        return 'golden'
    } else if (i <= 123) {
        yuanshi -= 160
        money.innerHTML = yuanshi;
        return 'purple'
    } else if (i <= 523) {
        yuanshi -= 160
        money.innerHTML = yuanshi;
        return 'blue'
    } else {
        yuanshi -= 160
        money.innerHTML = yuanshi;
        return 'green'
    }
}

function danchou() {
    switch (mathnum()) {
        case 'golden':
            alert('金色')
            break;
        case 'purple':
            alert('紫色')
            break;
        case 'blue':
            alert('蓝色')
            break;
        case 'green':
            alert('绿色')
            break;
        default:
            break;
    }
}

function tenmath() {
    if (yuanshi < 1600) {
        alert('你的原石不够哦')
        return
    }
    var num = []
    for (var i = 1; i <= 10; i++) {
        num.push(mathnum())
    }
    return num
}

function tenchou() {
    var num1 = tenmath()
    var num2 = []
    for (var i = 0; i < num1.length; i++) {
        switch (num1[i]) {
            case 'green':
                num2.push('绿色')
                break;
            case 'blue':
                num2.push('蓝色')
                break;
            case 'purple':
                num2.push('紫色')
                break;
            case 'golden':
                num2.push('金色')
                break;
            default:
                break;
        }
    }
    alert(num2)


}

function getyuanshi98() {
    yuanshi += 980;
    qian += 98
    money.innerHTML = yuanshi;

}

function getyuanshi198() {
    yuanshi += 1980;
    qian += 198
    money.innerHTML = yuanshi;

}

function getyuanshi328() {
    yuanshi += 3280;
    qian += 328
    money.innerHTML = yuanshi;

}

function getyuanshi648() {
    yuanshi += 6480;
    qian += 648
    money.innerHTML = yuanshi;

}

function gettask1() {
    qqr1.src = './img/qqr.png'
    task1.style.display = 'none'

}